package com.dengqi.mymodule.activity.jsoup;

import com.dengqi.mymodule.activity.network.base.BasePresenter;
import com.dengqi.mymodule.activity.network.util.CheckUtil;
import com.dengqi.mymodule.activity.network.util.ConstantUtil;
import com.module.retrofit.RetrofitHelper;
import com.module.retrofit.bean.ResponseBean;
import com.module.retrofit.callback.BaseObserver;
import com.module.retrofit.utils.HeaderUtils;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;

import java.util.LinkedHashMap;
import java.util.Map;

import io.reactivex.ObservableSource;
import io.reactivex.functions.Function;


/**
 * @Author: dengqi
 * @CreateDate: 2020-10-15 19:51
 * @Description:
 */
public class JSPresenter extends BasePresenter implements JSContontract.Presenter {


    private JSContontract.Model model;

    public JSPresenter(RxAppCompatActivity activity){
        super(activity);
        this.model = RetrofitHelper.getApiService(JSContontract.Model.class);
    }


    @Override
    public void getTest(JSContontract.View view) {
        Map<String, String> parmas = new LinkedHashMap<>();
        execute(model.getTest(parmas))
                .subscribe(new BaseObserver<String>(activity) {
                    @Override
                    public void onSuccess(String result) {
                        view.onTest(result);

                    }

                });
    }

}
